home *** CD-ROM | disk | FTP | other *** search
- This is not for now, but as I've found it, I give it before I forget.
- It is a HTML page, to view with mosaic or netscape, or cello, as you wish
-
- <!DOCTYPE HTML SYSTEM "html.dtd">
- <HTML><HEAD><TITLE>The unofficial LMP format description</TITLE></HEAD>
- <BODY><H1>The unofficial LMP format description<BR>Public Version
- 1.10 (internal revision 20) - 24.10.1994</H1>
- <P><B>Written by:Uwe Girlich (girlich@aix520.informatik.uni-leipzig.de
- )</B></P>
- <H2>1. Introduction</H2>
- <P>A DOOM lmp file records all player actions. The monster movements,
- respawn positions etc. are totally deterministic. The messages during
- a multiplayer game (chat mode) do not appear in the lmp.
- </P>
- <P>A lmp file consists of a header, a data area and a quit byte.</P>
- <UL>
- <LI>The header contains the skill, episode, start map, number of
- players etc.</LI>
- <LI>The data area is divided in game tics. For each player there are
- four movement bytes per game tic.</LI>
- <LI>Each lmp should end with a quit byte (80h).</LI>
- </UL>
- <P>The duration of a gametic is round 1/35s. With time measurements
- with 4dos:</P>
- <PRE>timer ^ doom -playdemo name ^ timer</PRE>
- <P>of many differnet lmp's and linear curve fitting I found a slightly
- differnet frequency: 35.003Hz. So it is not wrong to speak of 35Hz but
- it is not totally correct.
- </P>
- <H2>2. HEADER</H2>
- <P>Many thanks to Steffen Winterfeldt
- (wfeldt@tph100.physik.uni-leipzig.de) for his reverse engineering work.</P>
- <P>The easiest way to check the length of the header is to start DOOM
- with the record option. Then you have to press 'q' during the startup
- sequence. In the moment, when the screen switchs from text mode to
- graphics mode, the game stops and you receive the shortest lmp file. It
- consists only of the header and the quit game byte.</P>
- <P>The lmp header format is a subject of change. Until DOOM 1.2 was
- the format of the 7 byte header:</P>
- <PRE>Byte Type Contents
- 0000h Byte skill (0-4)
- 0001h Byte episode (1-3)
- 0002h Byte map (1-9)
- 0003h Byte 0/1 (green player) \
- 0004h Byte 0/1 (indigo player) \ 0: this player doesnt play
- 0005h Byte 0/1 (brown player) / 1: this player plays
- 0006h Byte 0/1 (red player) /
- The number of bytes (3-6) unequal to zero is the number of players.
- </PRE>
- <P>From Version 1.4 on the header consists of 13 bytes:</P>
- <PRE>Byte Type Contents
- 0000h Byte version (104d=68h DOOM 1.4, 105d=69h DOOM 1.5, 106d=6Ah DOOM 1.6)
- 0001h Byte skill (0-4)
- 0002h Byte episode (1-3)
- 0003h Byte map (1-9)
- 0004h Byte multiplayer rule (0: Cooperative, 1: DeathMatch, 2: AltDeath)
- 0005h Byte respawn 0: off, !=0: on \ a value != 0 is the number of
- 0006h Byte fast 0: off, !=0: on > this command line parameter
- 0007h Byte nomonsters 0: off, !=0: on / (with expanded @paramfile)
- 0008h Byte the lmp is recorded from this player's view (0-3)
- 0009h Byte 0/1 (green player) \
- 000Ah Byte 0/1 (indigo player) \ 0: this player doesnt play
- 000Bh Byte 0/1 (brown player) / 1: this player plays
- 000Ch Byte 0/1 (red player) /
- The number of bytes (9-C) unequal to zero is the number of players.
-
- </PRE>
- <P>Now it is very easy to change a existing lmp from one format to the
- other. The movement algorithm didn't changed from DOOM 1.2 to DOOM 1.5
- beta. This is only true if the map also didn't changed. So you can't
- recycle lmp's of e1m4. It is very interesting, that 1.5 lmp's, recorded
- even with the turbo option work with 1.2.
- </P>
- <H2>3. DATA</H2>
- <H3>3.1 Number of game tics</H3>
- <P>This formula for the number of game tics (NGT) follows from the
- first section:
- </P>
- <PRE> filelength-headerlength-1
- NGT = -------------------------
- 4 * number of players
- </PRE>
- <P>The NGT stored in a lmp can also be found out with the -timedemo
- option. At the replay end, doom shows the number of game tics and time
- tics. This game tic number corresponds with NGT only in newer versions
- of DOOM (>=1.4). Older versions of DOOM report the wrong number
- (NGT+1).
- </P>
- <P>With timedemo DOOM plays __all__ scenes in the lmp file back but
- without any synchronizing. So you can calculate also the frames per
- second with:
- </P>
- <PRE>
- NGT
- fps = --------- * 35
- time tics
- </PRE>
- <P>This has nothing to do with your frame rate during the game. This
- frame rate can be computed with the formula (from the FAQ v5.8 (9-2-1),
- thanks to Hank Leukart (ap641@cleveland.freenet.edu))
- </P>
- <PRE> 70
- fps = --------
- dots + 1
- </PRE>
- <P>The dots are displayed with the -devparm option in the lower left
- edge of the screen. There are only 35 screens per second (each game
- tic), so one dot is always displayed. With every additional dot, DOOM
- shows how many vertical sync impulses (1/70s) were necessary to compute
- a whole screen. The game is not slower but you don't see each screen:
- the game becomes jerky.
- </P>
- <H3>3.2 Multiplayer lmp</H3>
- <P>In a 2, 3 or 4 player game the game tics are alternated stored, ie
- for a 2 player game:</P>
- <PRE>game tic 1 of player 0
- game tic 1 of player 1
- game tic 2 of player 0
- game tic 2 of player 1
- game tic 3 of player 0
- game tic 3 of player 1
- .
- .
- .
- </PRE>
- <H3>3.3 The -turbo parameter</H3>
- <P>This parameter speeds up all moves (forward, backward, strafe
- sideways) but not the turn. Due to the value sets described in section
- 3.4 all move bytes can be multiplied by 2.55 (or 255%) until they dont
- fit in a short int. This is exactly what happens. All normal move
- bytes are multiplied by the turbo value in percent. So you can play with
- -turbo 200 a normal game but your speed is the same as the shift key is
- always pressed. If you now press the shift key you are running like
- hell.</P>
- <P>The turbo parameter isn't stored in the lmp but DOOM shows in the
- message line, if a player plays with turbo (ie "green is turbo"). DOOM
- conclude this from very large move bytes.
- </P>
- <H3>3.4 Data description</H3>
- <P>One game tic (for one player) corresponds to 4 bytes:
- </P>
- <PRE> | 0 | 1 | 2 | 3 |
- | go | strafe | turn | use |
- </PRE>
- <H4>3.4.1. Byte 00h: Go Forward and Backward</H4>
- <P>The go byte contains a signed number (-127 (81h).. 127 (7Fh)), where
- positive numbers describe a forward and negative numbers a backward
- move. In older DOOM versions (and now with -turbo 100) the values go
- from -50 (CEh)... 50 (32h).</P>
- <P>With a mouse you can achive all these codes. The codes for
- keyboard/joystick actions are:</P>
- <PRE>-25 (E7h) / +25 (19h) go backward/forward
- -50 (CEh) / +50 (32h) go backward/forward with speed on
- </PRE>
- <H4>3.4.2 Byte 01h: Strafe Sideways</H4>
- <P>The strafe byte contains a signed number (-127 (81h).. 127 (7Fh)),
- where positive numbers describe a right and negative numbers a left
- move. In older DOOM versions (and now with -turbo 100) the values go
- from -50 (CEh)... 50 (32h).</P>
- <P>With a mouse you can achive all these codes. The codes for
- keyboard/joystick actions are:</P>
- <PRE>-24 (E8h) / +24 (18h) strafe left/right
- -50 (CEh) / +50 (32h) strafe left/right with speed on
-
- </PRE>
- <H4>3.4.3 Byte 02h: Turn</H4>
- <P>The turn byte contains a signed number (-127 (81h).. 127 (7Fh)),
- where positive numbers describe a left and negative numbers a right
- turn. The values go from -127 (81h)... 127 (7Fh). In my lmp's the
- maximal values are Turn Left 76 (4Ch) and Turn Right 78 (B2h). With a
- mouse you can achive all these codes.
- </P>
- <PRE> 360
- The turn angle is --- * turn_byte degree.
- 256
- </PRE>
- <P>With IDMYPOS you can check your current viewing direction. During
- recording DOOM uses only a byte out of a long for the viewing angle:
- </P>
- <PRE> (40h)
- N
-
- (80h) W + E (00h)
-
- S
- (C0h)
- </PRE>
- <P>The turn byte is directly the increment of the viewing angle.
- </P>
- <P>The codes for keyboard/joystick actions (in DOOM version <1.4)
- are:
- </P>
- <PRE> -2 (FEh) / +1 (01h) start turn right/left
- -3 (EDh) / +2 (02h) turn right/left
- -5 (FBh) / +5 (05h) turn right/left with speed on
- </PRE>
- <P>Very strange is the fact, that the keyboard controlled right turn is
- faster than the keyboard controlled left turn. This must be a bug.
- </P>
- <P>The codes for keyboard/joystick actions (in DOOM version >=1.4)
- are:
- </P>
- <PRE> -1 (FEh) / +1 (01h) start turn right/left
- -2 (EDh) / +3 (02h) turn right/left
- -5 (FBh) / +5 (05h) turn right/left with speed on
- </PRE>
- <P>Now some people at id corrected the right turn but now is the left
- turn a bit faster.
- </P>
- <H4>3.4.4 Byte 03h: Use</H4>
- <P>In the use byte are coded the fire weapon, the press button/open
- door and the change weapon actions:</P>
- <PRE> --------------------------------------------
- | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
- | SA=0 | 0 | Weapon | WB | UB | FB |
- --------------------------------------------
- </PRE>
- <P>The Fire Bit (FB) is 1 during a shot. The Use Bit (UB) indicates the
- use of anything (press a button, open a door etc.). The Weapon Bit (WB)
- is 1 if the player changes manually his weapon. The weapon number is
- stored in the following bits.
- </P>
- <P>The weapon numbers are beginning with 0; not with 1 as is the status
- bar:
- </P>
- <PRE> Code := 4 + 8* (Weapon-1)
- </PRE>
- <P>The codes are:
- </P>
- <PRE> 4 (04h) Activate Weapon 1 (Fist)
- 12 (0Ch) Activate Weapon 2 (Pistol)
- 20 (14h) Activate Weapon 3 (Shotgun)
- 28 (1Ch) Activate Weapon 4 (Chaingun)
- 36 (24h) Activate Weapon 5 (Rocket Launcher)
- 44 (2Ch) Activate Weapon 6 (Plasma Rifle)
- 52 (34h) Activate Weapon 7 (BFG 9000)
- 60 (3Ch) Activate Weapon 8 (Chainsaw)
- </PRE>
- <P>The bits can be composed. So you can with a use byte of 03h fire and
- use at the same time.
- </P>
- <P>If the Special Actions (SA) bit is 1, the meaning of the other bits
- changes totally:
- </P>
- <P>In the bits 0 and 1 is now coded the Special Action itself.
- </P>
- <PRE>-----------------
- |1|x|x|x|x|x|0|1| stands for pause/unpause
- -----------------
-
- </PRE>
- <P>and</P>
- <PRE>-----------------
- |1|x|x| SLN |1|0| stands for save game in slot SLN (0<=SLN<=7).
- -----------------
- </PRE>
- <P>The x-bits aren't important at all. DOOM itselft let they 0 but does
- not analyze them afterwards.
- </P>
- <P>DOOM saves the game even during the replay of a lmp.
- </P>
- <H4>3.4.5. Special entries</H4>
- <P>If there are no actions at all, all 4 bytes contain 00h. This is a
- wait tic. The end of the lmp is coded in the go byte of an uncomplete
- game tic. Because there is no go value of -128 (80h), DOOM can't make a
- mistake.
- </P></BODY></HTML>
- +-----------------------------------------------------------+
- |Bertrand Le Roy |A Darwinian theory of Gravitation: |
- |bleroy@ccr.jussieu.fr|In the beginning, mature apples fell|
- |tel. 44.27.72.95 |in all directions. But only the trees|
- |fax. 44.27.72.87 |whose apples fell down have survived.|
- +-----------------------------------------------------------+
- |Laboratoire de Gravitation et Cosmologie Relativistes |
- |Universite Pierre et Marie Curie, tour 22-12, 4e etage |
- |4, place Jussieu, 75252 Paris Cedex 05 |
- +-----------------------------------------------------------+
-
-